The invention relates to an apparatus for accessing Java methods contained in a Java class and method database by an application, the database being stored in a local computer and accessed by a server running in a Java environment on the local computer. The invention also relates to a process for accessing Java methods and a program product stored on a data carrier for controlling a computer to perform this process.
Access to Java (trademark of Sun Microsystems, Inc.) methods by non-Java application programs requires programming against a detailed interface specification which must be known at implementation time. Furthermore, implementations of this type are specific to the interface for which they are programmed. Any interface change thus causes reprogramming effort. In addition, some programming environments do not support Java access and thus specific communication modules would have to be developed to overcome this barrier.
It is known to use distributed Java applications wherein programs running on a computer may invoke methods of Java objects which reside on another computer. Such remote use is permitted by the Remote Method Invocation (RMI) interface as described in the book xe2x80x9cJAVA RMI: Remote Method Invocationxe2x80x9d, T. B. Downing, IDG Books, 1998, ISBN 0-7645-8043-4.
It is an object of the invention to allow access to Java methods by non-Java applications in a more effective manner requiring less programming effort. It is also an object of the invention to provide means which allow the use of a simple interface for a remote invocation of Java methods by non-Java applications through a data communication network.
According to the invention, as defined in the claims, a non-Java application generates a standard TCP/IP communication call for a method of a Java class in a Java class and method database. A Java service server receives requests for method calls and processes these requests including conversion of the method call and related parameter data from a transport format into Java native data types. The converted data is used for invoking a Java method which then executes by applying the method to the converted parameter data. The resulting data of the method execution is converted from the Java format into the transport format in which it is transmitted to the non-Java application.
TCP/IP is well established as a standard means for communication within all IT environments. The present invention provides access to Java applications via TCP/IP communication. The application programmer only needs to program against standard TCP/IP communication calls. For the purpose of performing the communication on the Java side a Java service server is started. This server creates an instance of the class to be accessed and provides an interface to native data types which may be used to call Java methods within an instantiated class.
The basic communication between the non-Java client and the Java server module is text based and, as such, is independent from machine and operating system specifics. The server also supports transmission of help information.
By using TCP/IP communication calls for the invocation of Java methods, the interface between the non-Java application and native Java data types is kept extremely simple. This approach makes it possible to create a link between applications written in low-end programming languages like Shellscript, pearl, C or Visual Basic and Java applications. The server can be used by a remote non-Java application through a network such as the Internet.
The interface which is provided by the server is fully configurable and driven by a configuration file. The configuration file can be created with the information provided by the JavaDoc files of the code to be accessed.